package org.example.service.impl;

import jakarta.annotation.Resource;
import org.example.mapper.StoreMapper;
import org.example.entity.Store;
import org.springframework.stereotype.Service;
import org.example.service.StoreService;
import org.springframework.transaction.annotation.Transactional;

@Service
public class StoreServiceImpl implements StoreService {
    @Resource
    private StoreMapper storeMapper;
    @Override
    @Transactional
    public void deduct(String commodityCode, int count) {

        storeMapper.update(new Store(null,commodityCode, count));

    }
    @Override
    public void insert(String commodityCode, int count) {
        storeMapper.insert(new Store(null,commodityCode, count));
    }
}
